import random
import numpy as np


def InitPop(NIND, N):
    """
    初始化种群
    :param NIND: 种群大小
    :param N:    个体染色体长度(城市数目)
    :return:    随机产生的初始化种群
    """
    Chrom = np.zeros((NIND, N))
    for i in range(NIND):
        Chrom[i] = [i for i in range(1, N + 1)]
        random.shuffle(Chrom[i])
    return Chrom
